package com.eclipse.training;

import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;

public class ImagesRegistry extends ImageRegistry {
	public static final String ICN_ASTEROID = "icon.asteroid";
	public static final String ICN_DARK_MATTER = "icon.dark.matter";
	public static final String ICN_GALAXY = "icon.galaxy";
	public static final String ICN_GALAXY_CLUSTER = "icon.galaxy.cluster";
	public static final String ICN_NEBULA = "icon.nebula";
	public static final String ICN_PLANET = "icon.planet";
	public static final String ICN_SATELLITE = "icon.satellite";
	public static final String ICN_SOLAR_SYSTEM = "icon.solar.system";
	public static final String ICN_STAR = "icon.star";
	public static final String ICN_STAR_CLUSTER = "icon.star.cluster";
	public static final String ICN_SORT = "icon.sort";
	public static final String ICN_FILTER = "icon.filter";
	
	public static final String DECORATOR = "decorator";

	private static ImagesRegistry instance;

	private ImagesRegistry() {
		super();

		Display display = Display.getCurrent();

		/*
		 * Register the images
		 */
		put(ICN_ASTEROID, new Image(display, "icons/asteroid.png"));
		put(ICN_DARK_MATTER, new Image(display, "icons/dark.png"));
		put(ICN_GALAXY, new Image(display, "icons/galaxy.png"));
		put(ICN_GALAXY_CLUSTER, new Image(display, "icons/galaxycluster.png"));
		put(ICN_NEBULA, new Image(display, "icons/nebula.png"));
		put(ICN_PLANET, new Image(display, "icons/planet.png"));
		put(ICN_SATELLITE, new Image(display, "icons/satellite.png"));
		put(ICN_SOLAR_SYSTEM, new Image(display, "icons/solarsystem.png"));
		put(ICN_STAR, new Image(display, "icons/star.png"));
		put(ICN_STAR_CLUSTER, new Image(display, "icons/starcluster.png"));
		put(ICN_SORT, new Image(display, "icons/sort.gif"));
		put(ICN_FILTER, new Image(display, "icons/filter.gif"));
		
		put(DECORATOR, new Image(display, "icons/decorator.gif"));
	}

	public static ImagesRegistry getInstance() {
		if (instance == null)
			instance = new ImagesRegistry();

		return instance;
	}
}
